﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXVIII.Entity;

namespace XXVIII.DAL.SqlServerDAL
{
    public class DefaultValueRule
    {
        public static void SetCreateSignTable(CreateCloumnEntity info)
        {
            if (info.ColumnType == "nvarchar"
                || info.ColumnType == "varchar"
                || info.ColumnType == "char"
                || info.ColumnType == "nchar")
            {
                if (info.Length == 0)
                {
                    info.Length = 128;
                }
            }
            else if (info.ColumnType == "decimal")
            {
                if (info.Length == 0 && info.DecimalLength == 0)
                {
                    info.Length = 18;
                }
            }
            //else if (info.ColumnType == "datetime")
            //{
            //    if (info.Length == 0)
            //    {
            //        info.Length = 23;
            //    }
            //}
            //else if (info.ColumnType == "uniqueidentifier")
            //{
            //    if (info.Length == 0)
            //    {
            //        info.Length = 16;
            //    }
            //}

        }

       
    }
}
